package com.yidu.best.bond.securitiesArap.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.yidu.best.bond.securitiesArap.dao.SecuritiesArapDao;
import com.yidu.best.bond.securitiesArap.domain.SecuritiesArap;
import com.yidu.best.bond.securitiesArap.domain.SecuritiesArapVo;
import com.yidu.best.bond.securitiesArap.service.SecuritiesArapService;
@Service
public class SecuritiesArapServiceImpl implements SecuritiesArapService{
	@Autowired
	private SecuritiesArapDao securitiesArapDao;

	@Override
	public Map<String, Object> findPageQuery(SecuritiesArapVo securitiesArapVo) {
		// 调用dao层方法查询数量
				int count = securitiesArapDao.countSecuritiesArap(securitiesArapVo);
				// 计算页码
				int page = (securitiesArapVo.getPage() - 1) * securitiesArapVo.getLimit();
				securitiesArapVo.setPage(page);
				// 调用dao层方法分页查询
				List<SecuritiesArap> capitalTransferList = securitiesArapDao.findPageQuery(securitiesArapVo);
				Map<String, Object> map = new HashMap<String, Object>();
				// 将数据存入map中
				map.put("code", 0);
				map.put("count", count);
				map.put("data", capitalTransferList);
				return map;
	}

}
